const Koa = require('koa');

const cors = require('koa2-cors');
const bodyParser = require('koa-bodyparser');
const useRoutes = require('../router/index');

const app = new Koa();

app.useRoutes = useRoutes;

app.use(cors()); //全部允许跨域
app.use(bodyParser());
app.useRoutes();

module.exports = app;